<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>存储事件1</title>
</head>
<body>
  <h2>用于监听存储事件的页面</h2>
  <script>
    window.addEventListener('storage', event => {
      console.log(event.domain);
      console.log(event.key);
      console.log(event.newValue);
      console.log(event.oldValue);
    });
  </script>
</body>
</html>